import {
  showLoadingToast as vanShowLoadingToast,
  closeToast as vanCloseToast,
  showSuccessToast as vanShowSuccessToast,
  showFailToast as vanShowFailToast,
} from "vant";


export function showLoadingToast(text = "拼命加载中...") {
  vanShowLoadingToast({
    message: text,
    forbidClick: true,
  });
}

export const closeToast = vanCloseToast;
export function showSuccessToast(text = "Success") {
  vanShowSuccessToast({
    message: text,
    duration: 2000, // 单位：毫秒，设置为 0 表示不自动关闭
  });
}

export function showFailToast(text = "Fail") {
  vanShowFailToast({
    message: text,
    duration: 2000, // 单位：毫秒，设置为 0 表示不自动关闭
  });
}